#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read(){
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 1e5+10;

int n,K,tot,a[N<<1],l[N],r[N],cnt,lim,f[22][N<<1];

struct node{
	int l,r;
	node(int _l,int _r):l(_l),r(_r){}
	friend bool operator < (node a,node b){return a.r < b.l;}
};

set <node> s;

int calc(int l,int r){if(l > r) return 0; int res = 0; for(int i = lim;i >= 0;i--) if(f[i][l] <= r + 1) l = f[i][l],res += 1 << i; return res;}

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,K = in; for(int i = 1;i <= n;i++) l[i] = a[++cnt] = in,r[i] = a[++cnt] = in;
	sort(a + 1,a + cnt + 1); cnt = unique(a + 1,a + cnt + 1) - a - 1;
	for(int i = 1;i <= n;i++) l[i] = lower_bound(a + 1,a + cnt + 1,l[i]) - a,r[i] = lower_bound(a + 1,a + cnt + 1,r[i]) - a;
	lim = log(K) / log(2); for(int i = 1;i <= cnt + 5;i++) for(int j = 0;j <= lim;j++) f[j][i] = cnt + 5;
	for(int i = 1;i <= n;i++) f[0][l[i]] = min(f[0][l[i]],r[i]);
	for(int i = cnt;i >= 1;i--) {
		f[0][i] = min(f[0][i],f[0][i + 1]);
		for(int j = 1;j <= lim;j++) f[j][i] = min(f[j][i + 1],f[j - 1][f[j - 1][i]]);
	}
	tot = calc(1,cnt); s.insert(node(1,cnt)); if(tot < K) return puts("-1"),0;
	vec ans;
	for(int i = 1;i <= n && K;i++){
		set <node> :: iterator it = s.find(node(l[i],r[i] - 1)); if(it == s.end()) continue; node t = *it;
		if(t.l <= l[i] && t.r >= r[i] -1){
			int delta = calc(t.l,l[i] - 1) + calc(r[i],t.r) - calc(t.l,t.r);
			if(delta + tot >= K - 1) {
				ans.pb(i), tot += delta; s.erase(it); K--;
				if(t.l <= l[i] - 1) s.insert(node(t.l,l[i] - 1)); if(t.r >= r[i]) s.insert(node(r[i],t.r));
			}
		}
	}
	for(auto x : ans) printf("%d\n",x);
	return 0;
}
